import request from "@/utils/request";

// 获取组织架构列表数据
export const getDepartmentList = () => {
  return request({
    url: '/company/department'
  })
}

// 获取部门负责人数据
export const getManagerList = () => {
  return request({
    url: "/sys/user/simple",
  })
}

// 添加子部门
export const addDepartment = (data) => {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}

// 获取部门详情数据
export const getDepartmentDetail = (id) => {
  return request({
    url: `/company/department/${id}`
  })
}

// 编辑部门
export const editDepartment = (data) =>{
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}

// 删除部门
export const delDepartment = (id) => {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}